//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================
#ifndef __WINDOWS_MODULE_H_
#define __WINDOWS_MODULE_H_

Aura_ECode Win32Module_Load(
        /* [in] */ Aura_PWChar name,
        /* [in] */ Aura_ModuleLoadFlags flags,
        /* [out] */ Aura_Handle * phModule);
        
Aura_ECode Win32Module_Unload(
        /* [in] */ Aura_Handle hModule);
        
Aura_ECode Win32Module_Close(
        /* [in] */ Aura_Handle hModule);
        
Aura_ECode Win32Module_CreateModuleSnapshot(
        /* [in] */ Aura_ProcessId processId,
        /* [out] */ Aura_Handle * phSnapshot);
        
Aura_ECode Win32Module_CloseModuleSnapshot(
        /* [in] */ Aura_Handle hSnapshot);
        
Aura_ECode Win32Module_GetModuleNode(
        /* [in] */ Aura_Handle hSnapshot,
        /* [in] */ Aura_Bool bFirstNode,
        /* [out] */ Aura_Bool * pbExistedMore,
        /* [out] */ Aura_Handle * phModule);
        
Aura_ECode Win32Module_GetInformation(
        /* [in] */ Aura_ProcessId processId,
        /* [in] */ Aura_Handle hModule,
        /* [out] */ Aura_Address * pBaseAddr,
        /* [out] */ Aura_Address * pEntryAddr,
        /* [out] */ Aura_MemorySize * pSizeOfImage);
        
Aura_ECode Win32Module_GetFullFileName(
        /* [in] */ Aura_Handle hModule,
        /* [out] */Aura_PWChar pFullNameBuf,
        /* [in] */ Aura_Int32 bufSize);
        
Aura_ECode Win32Module_GetProcAddressByName(
        /* [in] */ Aura_Handle hModule,
        /* [in] */ Aura_PChar name,
        /* [out] */ Aura_Address * pProcAddress);
        
Aura_ECode Win32Module_GetProcAddressByOrdinal(
        /* [in] */ Aura_Handle hModule,
        /* [in] */ Aura_Int32 ordinal,
        /* [out] */ Aura_Address * pProcAddress);
        
Aura_ECode Win32Module_GetResourceSection(
        /* [in] */ Aura_Address imageBaseAddr,
        /* [out] */ Aura_Address * pSectBaseAddr);
        
Aura_ECode Win32Module_GetResource(
    /* [in] */ Aura_Handle hModule,
    /* [in] */ Aura_PWChar resName,
    /* [in] */ Aura_PWChar resType,
    /* [out] */ Aura_Address * pAddress,
    /* [out] */ Aura_MemorySize * pSize);

#endif  //__WINDOWS_MODULE_H_
